//
//  WFFailView.m
//  谷居
//
//  Created by dllo on 16/6/17.
//  Copyright © 2016年 刘万方. All rights reserved.
//  网络请求失败

#import "WFFailView.h"

@implementation WFFailView
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        [self createFailView];
    }
    return self;
}


- (void)createFailView {
    _photoImageView = [[WFPhotoView alloc] initWithFrame:CGRectMake(100, 150, 150, 100)];
    [self addSubview:_photoImageView];
    [_photoImageView release];
    _photoImageView.image = [UIImage imageNamed:@"网络请求失败.png"];
    
    _reloadButton = [[WFLikeButton alloc] initWithFrame:CGRectMake(140, 260, 100, 40)];
    [self addSubview:_reloadButton];
    [_reloadButton release];
    
    [_reloadButton setTitle:@"点击刷新" forState:UIControlStateNormal];
    [_reloadButton addTarget:self action:@selector(clickReloadButton:) forControlEvents:UIControlEventTouchUpInside];
    
    
}

- (void)clickReloadButton:(WFLikeButton *)button {
    [self.delegate reloadAgain];
}


- (void)dealloc {
    [super dealloc];
}

@end
